#import "BWThread.h"

#import "BWThreadColor.h"
#import "BWSymbol.h"


NSString *BWThread_CopiedRowsType = @"BWThread Copied Rows Type";;


@implementation BWThread

+ (void) initialize
{
    [super initialize];
    [BWThread setVersion: 1.0];

} // initialize


- (void) dealloc
{
    [super dealloc];
} // dealloc


- (void) setColor: (BWThreadColor *) color
{
    [self willChangeValueForKey: @"color"];

    [color retain];
    [threadColor release];

    threadColor = color;

    [self didChangeValueForKey: @"color"];

} // setColor


- (BWThreadColor *) color
{
    return (threadColor);
} // color


- (void) setSymbol: (BWSymbol *) s
{
    [self willChangeValueForKey: @"symbol"];

    [s retain];
    [symbol release];

    symbol = s;

    [self didChangeValueForKey: @"symbol"];

} // setSymbol


- (BWSymbol *) symbol
{
    return (symbol);
} // symbol


- (void) encodeWithCoder: (NSCoder *) coder
{
    [coder encodeObject: threadColor];
    [coder encodeObject: symbol];
    
} // encodeWithCoder


- (id) initWithCoder: (NSCoder *) coder
{
    if (self = [super init]) {
        threadColor = [coder decodeObject];
        [threadColor retain];
        symbol = [coder decodeObject];
        [symbol retain];
    }

    return (self);

} // coder


@end // BWThread


